/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.additional;

import com.sun.lwuit.Component;
import com.sun.lwuit.Label;
import com.sun.lwuit.List;
import com.sun.lwuit.list.DefaultListCellRenderer;

/**
 *
 * @author Kvest
 */
public class MenuListRenderer extends DefaultListCellRenderer
{
    public MenuListRenderer()
    {
        super(false);
    }
    
    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected)
    {
        Label element = (Label)super.getListCellRendererComponent(list,value,index,isSelected);
        
        if (value != null && (value instanceof CellItem))
        {
            element.setIcon(((CellItem)value).getIcon());
            element.setEnabled(((CellItem)value).isEnabled());
        }
        
        return element;
    }
}
